<!-- 刷卡数据列表 -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>刷卡数据列表</title>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.4.2/themes/default/easyui.css"/>" />
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.4.2/themes/icon.css"/>" />
</head>
<body>
	<script type="text/javascript">
		 var cardDataList=function(value,row,index){
			 var pic="";
			 if(row.SLOTCARD_EFFECT==1){
				 pic = "<input type='checkbox' disabled='disabled'>";
			 }else if(row.SLOTCARD_EFFECT==0){
				 pic = "<input type='checkbox' checked disabled='disabled'>";
			 }
			 return pic;
		 }
		 //刷新
		 $("#data_list_reload").linkbutton({
			 onClick:function(){
				$("#pp_card_data").datagrid("reload"); 
			 }
		 });
		$("#dd_button").linkbutton({
			onClick:function(){
				$("#dd_combobox").combobox("setValue","");
				var start = $("#dd_start").datetimebox("getText");
				var end =$("#dd_end").datetimebox("getText");
				var text = $("#dd_text").textbox("getText");
				$("#pp_card_data").datagrid({url:"is_to_findTimecardDataListBydNameandTime?stainDate="+start+"&stainEndDate="+end+"&stainName="+text,method:'get'})
			}
		});
	</script>
	<div id="tbfor-carddata" class="easyui-panel"
		data-options="fit:true,border:false">
		<div style="padding: 5px; height:auto" id="disop_card_data">
			<!-- <a class="easyui-linkbutton Sa_add" data-options="iconCls:'icon-add'">新增</a> -->
			<a
				class="easyui-linkbutton" data-options="iconCls:'icon-reload'" id="data_list_reload">刷新</a>
			
			<input id="dd_combobox" class="easyui-combobox" name="dept"
				data-options="label:'部门', width:150,labelWidth:50,panelHeight:'auto',
				valueField:'DEFIDE_ID',    
		        textField:'DEFIDE_NAME',    
		        url:'is_to_all_depts',    
		        onSelect: function(rec){
		        $('#dd_start').datetimebox('setValue','');
				$('#dd_end').datetimebox('setValue','');
				$('dd_text').textbox('setValue','');
		        	var dept = rec.DEFIDE_NAME;
		        	 $('#pp_card_data').datagrid({url:'is_to_findTimecardDataListBydName?dName='+dept,method:'get'}); 
					$('#pp_card_data').datagrid('reload');
		        }" /> 
		     <!--  <input class="easyui-combobox" name="dept"
				data-options="label:'班组', width:150,labelWidth:50,panelHeight:'auto',
				valueField:'holidayId',    
		        textField:'holidayName',    
		        url:'is_to_all_holiday',    
		        onSelect: function(rec){
		        	 
		        }" />  -->
		        <span
				class="xtb-sep" id=""></span> 开始日期从<input id="dd_start" type="text"
				class="easyui-datetimebox"> </input> 到<input id="dd_end" type="text"
				class="easyui-datetimebox"> </input> <span class="xtb-sep" id=""></span>
			搜素文本 <input class="easyui-textbox" id="dd_text" data-options="prompt:'名称'"
				style="width: 150px"> <a class="easyui-linkbutton"
				data-options="iconCls:'icon-search'" id="dd_button">搜素</a>
		</div>
		<table class="easyui-datagrid" id="pp_card_data"
			data-options="   
			method:'post',
			pagination:true,   
			url:'is_all_creditcard_data',  
			pageSize:5,     
			pageList: [5,10,20,30,40], 
			rownumbers:true,
			fit:true,
			fitColumns:true,
			Striped:true, 
			singleSelect:true,
			toolbar:'#disop_card_data', 
			striped:true
			">
			<thead>
			<!-- ,
					formatter: function(value,row,index){
					return new Object(row['staffInformation']).stainId;
					} -->
				<tr>
					<th data-options="field:'SLOTCARD_ID',width:50,align:'center'">编号</th>
					 <th data-options="field:'STAIN_ID',width:50,align:'center' ">员工编号</th>
					<th data-options="field:'STAIN_NAME',width:70,align:'center'">员工名称</th>
					<th data-options="field:'DEFIDE_NAME',width:80,align:'center'">部门</th>
					<!-- <th data-options="field:'className',width:100,align:'center'">班组</th> -->
					<th data-options="field:'SLOTCARD_DATE',width:100,align:'center',formatter:function(value,row,index){
						if(value!=null){
							var date= new Date(value);
							return date.toLocaleString();
						}
						return;
					}">刷卡时间</th>
					<th data-options="field:'SLOTCARD_REASON',width:100,align:'center'">原因</th>
					<th data-options="field:'SLOTCARD_EFFECT',width:70,align:'center',formatter:cardDataList">有效</th>
					
				</tr>
			</thead>
			<tbody>
				
			</tbody>
		</table>
	</div>
</body>
</html>